import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
// const routes: Array<RouteRecordRaw>
const routes: Array<any> = [
    {
        path: '/',
        name: '首页',
        component: () => import('@/views/index.vue'),
        redirect: '/home',
        meta: {
            title: '首页'
        },
        children: [
            {
                path: '/home',
                name: '首页',
                component: () => import('@/views/home.vue'),
                icon: 'el-icon-s-home',
            },
            {
                path: '/about',
                name: '关于',
                component: () => import('@/views/About.vue'),
                icon: 'el-icon-s-promotion',
                meta: {
                    title: '关于'
                },
                children: [
                    {
                        path: '/about',
                        name: '详情',
                        component: () => import('@/views/home.vue'),
                        icon: 'el-icon-s-home',
                        meta: {
                            title: '详情'
                        },
                    }
                ]
            }
        ]
    }
]
const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
